package com.marsproj.bankingmanagesystem.service;

import com.marsproj.bankingmanagesystem.dao.AccountDao;
import com.marsproj.bankingmanagesystem.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Service
public class AccountServiceImpl implements AccountService{

    @Autowired
    private AccountDao accountDao;

    @Override
    public int addAccount(Account account) {
        accountDao.addAccount(account);
        return 0;
    }

    @Override
    public List<Map> queryAll() {
        return accountDao.queryAll();
    }

    @Override
    public BigDecimal queryOne(String uid) {
        return accountDao.queryOne(uid);
    }

    @Override
    public int handleDeal(BigDecimal money, String uid) {
        accountDao.handleDeal(money,uid);
        return 0;
    }
}
